﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="CadastrarOrientador.aspx.cs" Inherits="RepositorioDeMonografia.CadastrarOrientador" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <fieldset class="CadastraCurso">
        <legend>Cadastrar Orientador</legend>
        <form id="CadastraOrientador" method="post" action="">
        <div>
            <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" CellPadding="4"
                DataKeyNames="Id" DataSourceID="SqlDataSourceOrientador" DefaultMode="Insert"
                ForeColor="#333333" GridLines="None" Height="152px" Width="433px">
                <Fields>
                    <asp:BoundField DataField="Id" HeaderText="Id" InsertVisible="False" ReadOnly="True"
                        SortExpression="Id" />
                    <asp:TemplateField HeaderText="Nome" SortExpression="Nome">
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Height="23px" Text='<%# Bind("Nome") %>'
                                Width="250px"></asp:TextBox>
                        </InsertItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Endereco" SortExpression="Endereco">
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Endereco") %>' Height="23px"
                                Width="250px"></asp:TextBox>
                        </InsertItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Telefone" SortExpression="Telefone">
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("Telefone") %>' Height="23px"
                                Width="250px"></asp:TextBox>
                        </InsertItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Celular" SortExpression="Celular">
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Celular") %>' Height="23px"
                                Width="250px"></asp:TextBox>
                        </InsertItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Email" SortExpression="Email">
                        <InsertItemTemplate>
                            <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Email") %>' Height="23px"
                                Width="250px"></asp:TextBox>
                        </InsertItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ButtonType="Button" CancelText="Limpar" InsertText="Cadastrar"
                        ShowInsertButton="True" />
                </Fields>
            </asp:DetailsView>
            <asp:SqlDataSource ID="SqlDataSourceOrientador" runat="server" ConflictDetection="CompareAllValues"
                ConnectionString="<%$ ConnectionStrings:ConnectionString %>" DeleteCommand="DELETE FROM [Orientador] WHERE [Id] = @original_Id AND (([Nome] = @original_Nome) OR ([Nome] IS NULL AND @original_Nome IS NULL)) AND (([Endereco] = @original_Endereco) OR ([Endereco] IS NULL AND @original_Endereco IS NULL)) AND (([Telefone] = @original_Telefone) OR ([Telefone] IS NULL AND @original_Telefone IS NULL)) AND (([Celular] = @original_Celular) OR ([Celular] IS NULL AND @original_Celular IS NULL)) AND (([Email] = @original_Email) OR ([Email] IS NULL AND @original_Email IS NULL))"
                InsertCommand="INSERT INTO [Orientador] ([Nome], [Endereco], [Telefone], [Celular], [Email]) VALUES (@Nome, @Endereco, @Telefone, @Celular, @Email)"
                OldValuesParameterFormatString="original_{0}" SelectCommand="SELECT [Id], [Nome], [Endereco], [Telefone], [Celular], [Email] FROM [Orientador]"
                UpdateCommand="UPDATE [Orientador] SET [Nome] = @Nome, [Endereco] = @Endereco, [Telefone] = @Telefone, [Celular] = @Celular, [Email] = @Email WHERE [Id] = @original_Id AND (([Nome] = @original_Nome) OR ([Nome] IS NULL AND @original_Nome IS NULL)) AND (([Endereco] = @original_Endereco) OR ([Endereco] IS NULL AND @original_Endereco IS NULL)) AND (([Telefone] = @original_Telefone) OR ([Telefone] IS NULL AND @original_Telefone IS NULL)) AND (([Celular] = @original_Celular) OR ([Celular] IS NULL AND @original_Celular IS NULL)) AND (([Email] = @original_Email) OR ([Email] IS NULL AND @original_Email IS NULL))">
                <DeleteParameters>
                    <asp:Parameter Name="original_Id" Type="Int32" />
                    <asp:Parameter Name="original_Nome" Type="String" />
                    <asp:Parameter Name="original_Endereco" Type="String" />
                    <asp:Parameter Name="original_Telefone" Type="String" />
                    <asp:Parameter Name="original_Celular" Type="String" />
                    <asp:Parameter Name="original_Email" Type="String" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:Parameter Name="Nome" Type="String" />
                    <asp:Parameter Name="Endereco" Type="String" />
                    <asp:Parameter Name="Telefone" Type="String" />
                    <asp:Parameter Name="Celular" Type="String" />
                    <asp:Parameter Name="Email" Type="String" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="Nome" Type="String" />
                    <asp:Parameter Name="Endereco" Type="String" />
                    <asp:Parameter Name="Telefone" Type="String" />
                    <asp:Parameter Name="Celular" Type="String" />
                    <asp:Parameter Name="Email" Type="String" />
                    <asp:Parameter Name="original_Id" Type="Int32" />
                    <asp:Parameter Name="original_Nome" Type="String" />
                    <asp:Parameter Name="original_Endereco" Type="String" />
                    <asp:Parameter Name="original_Telefone" Type="String" />
                    <asp:Parameter Name="original_Celular" Type="String" />
                    <asp:Parameter Name="original_Email" Type="String" />
                </UpdateParameters>
            </asp:SqlDataSource>
        </div>
        </form>
    </fieldset>
</asp:Content>
